<script setup>
defineProps({
  isShowArrow: {
    type: Boolean,
    default: false
  },
  isActive: {
    type: Boolean,
    default: false
  },
  time: {
    type: Object
  }
})
</script>

<template>
  <div style="width: 100%">
    <div>
      <div class="line">
        <div :style="{color:isActive?'#CA927B':'#5E6362'}" class="time"><span
          style="margin-right: 30px">{{ time.date }}</span>{{ time.time }}
        </div>
        <div class="center">
          <el-icon v-if="isShowArrow" color="#A29FA0" size="24" style="position: absolute;top: -20px">
            <CaretTop />
          </el-icon>
          <div class="center-line"></div>
          <div :style="{background:isActive?'#67AD09':'#9DA09D'}" class="circle"
               style="border-radius: 50%;width: 10px;height: 10px;"></div>
          <div class="center-line"></div>
        </div>
        <div class="desc">
          <slot name="message"></slot>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.line {
  width: 100%;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;

  .time {
    flex: 3.5;
  }

  .center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    position: relative;

    &-line {
      background-color: #6AAD0E;
      width: 3px;
      height: 8px
    }
  }

  .desc {
    flex: 5.5;
  }
}
</style>